package com.smartleanx.module.hrm.dal.mysql.operationlog;

import java.util.*;

import com.smartleanx.framework.common.pojo.PageResult;
import com.smartleanx.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.smartleanx.framework.mybatis.core.mapper.BaseMapperX;
import com.smartleanx.module.hrm.dal.dataobject.operationlog.OperationLogDO;
import org.apache.ibatis.annotations.Mapper;
import com.smartleanx.module.hrm.controller.admin.operationlog.vo.*;

/**
 * 操作日志记录 Mapper
 *
 * @author 精益大师
 */
@Mapper
public interface OperationLogMapper extends BaseMapperX<OperationLogDO> {

    default PageResult<OperationLogDO> selectPage(OperationLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OperationLogDO>()
                .eqIfPresent(OperationLogDO::getDocType, reqVO.getDocType())
                .eqIfPresent(OperationLogDO::getCode, reqVO.getCode())
                .eqIfPresent(OperationLogDO::getOperator, reqVO.getOperator())
                .eqIfPresent(OperationLogDO::getOperateType, reqVO.getOperateType())
                .orderByDesc(OperationLogDO::getId));
    }

}
